<!--主页-->
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>MISS后台管理系统</title>
    <link rel="stylesheet" href="/hotel/css/layui.css">
    <link rel="stylesheet" href="/hotel/css/modules/laydate/default/laydate.css">
    <link rel="stylesheet" href="/hotel/css/modules/layer/default/layer.css">
    <link rel="stylesheet" href="/hotel/css/modules/code.css">
    <style>
        .room{
            width: 100px;
            height: 100px;
            background-color: #2e6da4;
            line-height: 100px;
            text-align: center;
            display: inline-block;
        }
    </style>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">MISS后台管理系统</div>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <img src="http://t.cn/RCzsdCq" class="layui-nav-img">
                    username
                </a>
            </li>
            <li class="layui-nav-item"><a href="">注销</a></li>
        </ul>
    </div>
    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                <!-- 侧边导航: <ul class="layui-nav layui-nav-tree layui-nav-side"> -->
                <li class="layui-nav-item">
                    <a href="index.html">首页</a>
                </li>
                <li class="layui-nav-item">
                <a href="javascript:;">散客开单</a>
                <dl class="layui-nav-child">
                    <dd><a href="Guests_check_in.html">宾客入住</a></dd>
                </dl>
            </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">订单</a>
                    <dl class="layui-nav-child">
                        <dd><a href="Order.html">所有订单</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">宾客结账</a>
                    <dl class="layui-nav-child">
                        <dd><a href="Ordinary_invoicing.html">结账</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">预定管理</a>
                    <dl class="layui-nav-child">
                        <dd><a href="Query_book.html">查询预定</a></dd>
                        <dd><a href="Add_a_reservation.html">添加预定</a></dd>
                        <dd><a href="Edit_reservation.html">编辑预定</a></dd>

                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">营业查询</a>
                    <dl class="layui-nav-child">
                        <dd><a href="Check-in_guest_enquiry.html">入住宾客查询</a></dd>
                        <dd><a href="Member_of_the_query.html">会员查询</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:;">系统设置</a>
                    <dl class="layui-nav-child">
                        <dd><a href="Data_management.html">数据管理</a></dd>
                        <dd><a href="VIP_set_up.html">VIP设置</a></dd>
                        <dd><a href="Billing_Settings.html">计费设置</a></dd>
                        <dd><a href="Set_up_the_room.html">房间设置</a></dd>
                        <dd><a href="Operator_setup.html">操作员设置</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <div style="padding: 15px;" id="roomId">
            <button type="button" class="layui-btn layui-btn-primary">所有房间</button>
            <button type="button" class="layui-btn layui-btn-primary">单人房</button>
            <button type="button" class="layui-btn layui-btn-primary">标准房</button>
            <button type="button" class="layui-btn layui-btn-primary">大床房</button><br/><br/>
            <!--<img src="../img/timg1.jpg" alt="miss酒店" style="width: 100%;height:530px">-->
            <div class="room" onclick="openResult()">8001</div>
            <div class="room"><a href="javascript:;">8002</a></div>
        </div>
    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->
        © MISS酒店
    </div>
</div>
<script src="/hotel/js/layui.all.js"></script>
<script src="/hotel/js/jquery.min.js"></script>
<script>
    function findAll() {
        $.ajax({
            url:"/roomtype",
            type:"get",
            async:true,
            success:function (mes) {
                var str="";
				for(var i=0;i<mes.lenth;i++){
					str="<button type='button' class='layui-btn layui-btn-primary'>所有房间</button>"+
					"<button type='button' class='layui-btn layui-btn-primary'>"+mes[i].name+"</button>"+
					"<div class='room' onclick='openResult()'>"+mes[i].RoomBean.roomNumber+"</div>"
				}
				$("#roomId").html(str);
            }
        });
    }
    function openResult(){
        var r = confirm("亲，您确定开房吗？")
        if (r == true) {
            alert("开房成功")
        }
    }
    findAll();
</script>
</body>
</html>